    /** 
    * PTurlmigration -  http://code.google.com/p/alui-toolbox/
    * Copyright (c) 2008-2009
    * by Fabien Sanglier
    *
    * This file is part of PTurlmigration.
    * 
    * PTurlmigration is free software: you can redistribute it and/or modify
    * it under the terms of the GNU General Public License as published by
    * the Free Software Foundation, either version 3 of the License, or
    * (at your option) any later version.
    * 
    * PTurlmigration is distributed in the hope that it will be useful,
    * but WITHOUT ANY WARRANTY; without even the implied warranty of
    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    * GNU General Public License for more details.
    * 
    * You should have received a copy of the GNU General Public License
    * along with PTurlmigration.  If not, see <http://www.gnu.org/licenses/>.
    */
    
package com.ppc.ptmigration;

public class PTURLMigrate {

	/**
	 * This Class replace string X with the new string Y within all the PT
	 * objects properties
	 * 
	 * @param args
	 */
	public static void main(String[] args) {
		String appname = "";
		String username = "";
		String password = "";
		String pattern = "";
		String replacement = "";
		boolean isDebug = false;
		
		try {
			appname = args[0];
			username = args[1];
			password = args[2];
			pattern = args[3];
			replacement = args[4];
			if(args.length > 5)
				isDebug = Boolean.valueOf(args[5]).booleanValue();
			
			if(isDebug){
				System.out.println("appname:"+appname);
				System.out.println("username:"+username);
				System.out.println("password:"+password);
				System.out.println("pattern:"+pattern);
				System.out.println("replacement:"+replacement);
			}
			
			try {
				MigrateUtil mgUtil = new MigrateUtil(appname, username,
						password, pattern, replacement, isDebug);

				mgUtil.migrateServerConfigObjects();

				mgUtil.migrateRemoteServerObjects();

				mgUtil.migrateWebServiceObjects();
				
				mgUtil.migrateCardObjects();
				
			} catch (Exception ex) {
				System.out.println("An exception occured during the migration: " + ex);
				ex.printStackTrace(System.out);
			}
		} catch (Exception ex) {
			System.out
					.println("An error occured with the entered parameters. Please enter all the required parameters. "
							+ "Usage: <appname> <username> <password> <RegularExpressionToSearch> <Replacement String> <Is Debug: true|false>");
			ex.printStackTrace(System.out);
		}
	}
}